<?php
// 中间件配置
return [
    // 别名或分组
    'alias' => [
        'auth.admin' => \app\middleware\AdminAuthMiddleware::class,
        'cross' => \app\middleware\CrossDomain::class,
    ],
    // 优先级设置，此数组中的中间件会按照数组中的顺序优先执行
    'priority' => [
        \app\middleware\CrossDomain::class,
        \app\middleware\AdminAuthMiddleware::class,
    ],
    // 中间件配置
    'config'   => [
        // 跨域中间件配置
        \think\middleware\AllowCrossDomain::class => [
            'Access-Control-Allow-Origin'      => '*',
            'Access-Control-Allow-Methods'     => 'GET,POST,PATCH,PUT,DELETE,OPTIONS',
            'Access-Control-Allow-Headers'     => 'Authorization,Content-Type,X-Token,If-Match,If-Modified-Since,If-None-Match,If-Unmodified-Since,X-Requested-With',
            'Access-Control-Max-Age'           => 1728000
        ]
    ]
];
